﻿using System;
using System.Collections.Generic;
using System.Data.Objects.DataClasses;
using System.Linq;
using System.Text;

namespace Rated.DAL.Db
{
    public partial class UserProfile : EntityObject
    {

        public string Location
        {
            
            get { string result = string.Empty;
            if (this.City != null)
                result += this.City.Name;
                if (this.State != null)
                {
                    if (result != string.Empty)
                        result += ", ";
                    result += this.State.Name;
                }
                if (this.Locality != null)
                {
                    if (result != string.Empty)
                        result += ", ";
                    result += this.Locality.Name;
                }
                if (this.Country != null)
                {
                    if (result != string.Empty)
                        result += ", ";
                    result += this.Country.Name;
                }
                if (this.Continent != null)
                {
                    if (result != string.Empty)
                        result += ", ";
                    result += this.Continent.Name;
                }




                return result;

            }




        }

        public string FullName
        {
            get
            {
                var result = string.Empty;
                if (!string.IsNullOrEmpty(Title))
                    result += Title;

                if (!string.IsNullOrEmpty(FirstName))
                {
                    if (result != string.Empty)
                        result += ' ';
                    result += FirstName;
                }
                if (!string.IsNullOrEmpty(LastName))
                {
                    if (result != string.Empty)
                        result += ' ';
                    result += LastName;
                }
                return result;
            }
        }
    }
}
